package com.ysm.smfu.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.ysm.smfu.R;
import com.ysm.smfu.bean.PayBusinessInfo;
import com.ysm.smfu.contans.SpKey;
import com.ysm.smfu.utils.UIUtils;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by Administrator on 2016/10/15.
 */
public class XiangqingFragment extends MyBaseFragment {

    @BindView(R.id.act_payset_name)
    TextView actPaysetName;
    @BindView(R.id.havePay_money)
    TextView havePayMoney;
    @BindView(R.id.havePay_jifen)
    TextView havePayJifen;
    @BindView(R.id.havePay_beizhu)
    TextView havePayBeizhu;

    private PayBusinessInfo payBusinessInfo;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = UIUtils.inflate(R.layout.fragment_xiangqing);
        ButterKnife.bind(this, view);
        Bundle arguments = getArguments();
        if (arguments != null) {
            payBusinessInfo = (PayBusinessInfo) arguments.getSerializable(SpKey.PAYBUSINESSINFO);
        }
        if (TextUtils.isEmpty(payBusinessInfo.pointsNum))
            havePayJifen.setVisibility(View.GONE);
        else {
            havePayJifen.setVisibility(View.VISIBLE);
            havePayJifen.setText(payBusinessInfo.pointsNum);
        }
        havePayBeizhu.setText(payBusinessInfo.remark);
        actPaysetName.setText(payBusinessInfo.bi.name);
        havePayMoney.setText(payBusinessInfo.price);
        return view;
    }

}
